package org.itboys.mobile.entity.mysql.product;

import org.itboys.mongodb.entity.BaseMySqlEntity;

import java.util.List;





/**
 * 作者：jiangxiong
 * 日期：2016年9月12日
 * 联系方式 ：empty90911@126.com
 * 描述：圣代_商品_分类_一级规格_实体
 */
public class SundayProductCategoryFirstStandard extends BaseMySqlEntity {
 
  
	private static final long serialVersionUID = -4855822066700111515L;


	private String name;
	private String image;//图片
	private Integer type;//类型 1颜色，2尺寸

	private Long categoryId; //分类ID
	private String categoryName; //

	private List<SundayProductCategorySecondStandard> children;

	public SundayProductCategoryFirstStandard() {
	}

	public SundayProductCategoryFirstStandard(long id,String name, String image, Integer type, Long categoryId) {
		super.setId(id);
		this.name = name;
		this.image = image;
		this.type = type;
		this.categoryId = categoryId;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public List<SundayProductCategorySecondStandard> getChildren() {
		return children;
	}

	public void setChildren(List<SundayProductCategorySecondStandard> children) {
		this.children = children;
	}

	public String  getTypeStr(){
		String typeStr= "";
		if(type==null)return typeStr;

		switch (type) {
			case 1:
				typeStr="颜色";
				break;
			case 2:
				typeStr="尺寸";
				break;
			default:
				break;
		}
		return typeStr;
	}
	//bootstrap下，树形菜单需要用到此属性
	public  boolean getExpanded(){
		if(children!=null&&children.size()>0){
			return true;
		}else{
			return false;
		}
	}
}
